package com.share.order.api.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.share.common.core.web.domain.BaseEntity;
import com.share.user.api.domain.UserInfoVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Id;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @return 13141
 * 2025/10/17
 * 15:09
 */
@Data
@Schema(description = "订单")
public class OrderInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @Id
    @Schema(description = "订单id")
    // @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    @Schema(description = "用户id")
    private Long userId;

    @Schema(description = "用户昵称")
    private String nickname;

    @Schema(description = "订单号")
    private String orderNo;

    @Schema(description = "充电宝编号")
    private String powerBankNo;

    @Schema(description = "借用开始时间")
    private Date startTime;

    @Schema(description = "借用站点id")
    private Long startStationId;

    @Schema(description = "借用站点名称")
    private String startStationName;

    @Schema(description = "借用机柜编号")
    private String startCabinetNo;

    @Schema(description = "归还时间")
    private Date endTime;

    @Schema(description = "归还站点id")
    private Long endStationId;

    @Schema(description = "归还站点名称")
    private String endStationName;

    @Schema(description = "归还机柜编号")
    private String endCabinetNo;

    @Schema(description = "借用时长")
    private Integer duration;

    @Schema(description = "费用规则")
    private String feeRule;

    @Schema(description = "费用规则id")
    private Long feeRuleId;

    @Schema(description = "总金额")
    private BigDecimal totalAmount;

    @Schema(description = "抵扣金额")
    private BigDecimal deductAmount;

    @Schema(description = "实际订单金额")
    private BigDecimal realAmount;

    @Schema(description = "微信付款时间")
    private Date payTime;

    @Schema(description = "微信支付订单号")
    private String transactionId;

    @Schema(description = "订单状态：0:充电中 1：未支付 2：已支付")
    private String status;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "创建者")
    private String createBy;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Schema(description = "更新者")
    private String updateBy;

    @Schema(description = "删除标志（0代表存在 2代表删除）")
    private String delFlag;

    @Schema(description = "备注")
    private String remark;

    @TableField(exist = false)
    private UserInfoVo userInfoVo;

    @TableField(exist = false)
    private List<OrderBill> orderBillList;

}
